//点击出现登录表格
const logBox = document.getElementById('log');
logBox.addEventListener("click", showPop)
//整个页面窗口
const body = document.getElementsByTagName("body")[0];
body.addEventListener("click", hidePop);
// 整个弹窗组成
const logInput = document.querySelector('.log-input');
// 弹出的实际展出内容
const logInputContain = document.querySelector('.log-input-contain');
logInputContain.addEventListener("click", (e) => {
  stopProp(e)
}
)

function showPop (e) {
  stopProp(e); 
  const display = logInput.style.display;
  // 当前是否是不显示的
  logInput.style.display = display === "none" ? "block" : "none";
}

function hidePop() {
  logInput.style.display = 'none';
}

// 阻止事件冒泡 e.cancelBubble = true是老方法
function stopProp (e) {
  e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true;
}